Skip to content

Tidy up feedback_messages.py - #27

Open
peterbjohnson wants to merge 1 commit into
24-show-detail-feedbackfrom
25-feedback-messages-tidyup
Open

Tidy up feedback_messages.py#27
peterbjohnson wants to merge 1 commit into
24-show-detail-feedbackfrom
25-feedback-messages-tidyup

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

Closes #25.

Stacked on #26, which is itself stacked on #23. Both will retarget as the chain merges.

Thresholds are recorded next to the labels. Reading feedback_messages.py alone gave no hint that "excellent" meant >= 0.90. Each dict now says what it is keyed by, and points at compare_MIDI.py for the constants that do the deciding.

focus_messagesfocus_preamble_messages. The old keys named the focus area but the values praised everything elsefocus_messages["pitch"] was "You've got a good understanding of the rhythm.", sitting directly above focus_advice_messages["pitch"], which meant the opposite. Keys are now rhythm / melody / melody_and_rhythm / developing, so the call site reads as what it does: when the focus is pitch, praise the rhythm.

detail_section_titles. "Note Detail:" and "Chord Detail:" were the last student-facing strings left in compare_MIDI.py, against what the module docstring claims. Only comments and docstrings mention them now.

Trailing spaces. Three messages ended in a space and are joined with "\n", so it did nothing — stripped. The rest are concatenated and the space matters, so there is now a comment saying so above the focus preambles and the chord suffixes. Stripping those would produce "…70% accurate.Missing note(s): C.".

No message text changed apart from those three trailing spaces; I diffed the constants against #26 to confirm. 85 tests pass, and the lint count is unchanged at 213.

🤖 Generated with Claude Code

- Record the cut-offs each dict is keyed by. The labels live here but the
  thresholds live in compare_MIDI.py, so "excellent" gave no clue that it
  meant >= 0.90.
- focus_messages -> focus_preamble_messages, keyed by what is being
  praised rather than by the focus area. focus_messages["pitch"] praised
  rhythm, which read backwards next to focus_advice_messages["pitch"].
- Move "Note Detail:" and "Chord Detail:" into detail_section_titles.
  They were the last student-facing strings left in compare_MIDI.py.
- Strip the trailing spaces that do nothing (three messages that are
  joined with newlines) and note why the remaining ones are needed: the
  focus preambles and the chord suffixes are concatenated.
- Pin the detail section titles by constant in the tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants